import axios from 'axios'
axios.default.header.post['Content-Type'] = 'application/x-www-form-urlencoded';
axios.defaults.baseURI = '后台接口公共前缀';
export function fetch(url,params){
	return new Promise((resolve,reject)=>{
		axios.post(url,params)
		.then(response => {
			resolve(response.data);
		})
		.catch((error) => {
			reject(error);
		})
	})
}

export default{
	commonApi(url,params){
		return fetch(url,params)
	}
}
